/*     */ package com.cr.business;
/*     */ 
/*     */ import com.cr.business.domain.CrPlatformPriceSetting;
/*     */ import com.cr.business.service.ICrPlatformPriceSettingService;
/*     */ import com.cr.common.annotation.Log;
/*     */ import com.cr.common.core.controller.BaseController;
/*     */ import com.cr.common.core.domain.AjaxResult;
/*     */ import com.cr.common.core.page.TableDataInfo;
/*     */ import com.cr.common.enums.BusinessType;
/*     */ import com.cr.common.utils.poi.ExcelUtil;
/*     */ import java.util.List;
/*     */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.ui.ModelMap;
/*     */ import org.springframework.web.bind.annotation.GetMapping;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.PostMapping;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/business/debt_setting"})
/*     */ public class CrDebtPriceSettingController extends BaseController {
/*  32 */   private String prefix = "business/debt_setting";
/*     */   
/*     */   @Autowired
/*     */   private ICrPlatformPriceSettingService crPlatformPriceSettingService;
/*     */   
/*     */   @RequiresPermissions({"business:debt_setting:view"})
/*     */   @GetMapping
/*     */   public String debt_setting() {
/*  41 */     return this.prefix + "/debt_setting";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:debt_setting:list"})
/*     */   @PostMapping({"/list"})
/*     */   @ResponseBody
/*     */   public TableDataInfo list(CrPlatformPriceSetting crPlatformPriceSetting) {
/*  52 */     startPage();
/*  53 */     //crPlatformPriceSetting.setPlaKey("debt");
/*  54 */     List<CrPlatformPriceSetting> list = this.crPlatformPriceSettingService.selectCrPlatformPriceSettingList(crPlatformPriceSetting);
/*  55 */     return getDataTable(list);
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:debt_setting:export"})
/*     */   @Log(title = "费用管理", businessType = BusinessType.EXPORT)
/*     */   @PostMapping({"/export"})
/*     */   @ResponseBody
/*     */   public AjaxResult export(CrPlatformPriceSetting crPlatformPriceSetting) {
/*  67 */     //crPlatformPriceSetting.setPlaKey("debt");
/*  68 */     List<CrPlatformPriceSetting> list = this.crPlatformPriceSettingService.selectCrPlatformPriceSettingList(crPlatformPriceSetting);
/*  69 */     ExcelUtil<CrPlatformPriceSetting> util = new ExcelUtil(CrPlatformPriceSetting.class);
/*  70 */     return util.exportExcel(list, "费用管理数据");
/*     */   }
/*     */   
/*     */   @GetMapping({"/add"})
/*     */   public String add() {
/*  79 */     return this.prefix + "/add";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:debt_setting:add"})
/*     */   @Log(title = "费用管理", businessType = BusinessType.INSERT)
/*     */   @PostMapping({"/add"})
/*     */   @ResponseBody
/*     */   public AjaxResult addSave(CrPlatformPriceSetting crPlatformPriceSetting) {
/*  91 */     //crPlatformPriceSetting.setPlaKey("debt");
/*  92 */     return toAjax(this.crPlatformPriceSettingService.insertCrPlatformPriceSetting(crPlatformPriceSetting));
/*     */   }
/*     */   
/*     */   @GetMapping({"/edit/{id}"})
/*     */   public String edit(@PathVariable("id") Long id, ModelMap mmap) {
/* 101 */     CrPlatformPriceSetting crPlatformPriceSetting = this.crPlatformPriceSettingService.selectCrPlatformPriceSettingById(id);
/* 102 */     mmap.put("crPlatformPriceSetting", crPlatformPriceSetting);
/* 103 */     return this.prefix + "/edit";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:debt_setting:edit"})
/*     */   @Log(title = "费用管理", businessType = BusinessType.UPDATE)
/*     */   @PostMapping({"/edit"})
/*     */   @ResponseBody

/*     */   public AjaxResult editSave(CrPlatformPriceSetting crPlatformPriceSetting) {
/* 115 */     //crPlatformPriceSetting.setPlaKey("debt");
/* 116 */     return toAjax(this.crPlatformPriceSettingService.updateCrPlatformPriceSetting(crPlatformPriceSetting));
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:debt_setting:remove"})
/*     */   @Log(title = "费用管理", businessType = BusinessType.DELETE)
/*     */   @PostMapping({"/remove"})
/*     */   @ResponseBody
/*     */   public AjaxResult remove(String ids) {
/* 128 */     return toAjax(this.crPlatformPriceSettingService.deleteCrPlatformPriceSettingByIds(ids));
/*     */   }
/*     */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\classes\com.zip!\com\cr\business\CrDebtPriceSettingController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */